<div class="detailsBox">
<div class="openBox">
	<div class="detaiTab">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
           <tbody>
   					<tr>
                        <td width="15%" align="right" class="bg">借款人姓： </td>
                        <td width="35%">${customer.user_surname} </td>
                        <td width="15%" align="right" class="bg">证件类型：</td>
                        <td>
							<#if "${customer.document_type}" ==	 "IDC" > 
							个人居民身份证
							<#elseif "${customer.document_type }" ==	 "PAS"> 
							个人护照
							<#elseif "${customer.document_type }" ==	 "GPAS"> 
							个人港澳居民来往内地通行证（香港）
							<#elseif "${customer.document_type }" ==	 "APAS"> 
							个人港澳居民来往内地通行证（澳门）
							<#elseif "${customer.document_type }" ==	 "OTH"> 
							其他
							</#if>
						</td>
                    </tr>
                     <tr>
                        <td width="15%" align="right" class="bg">借款人名：</td>
                        <td width="35%">${customer.user_name}</td>
                        <td width="15%" align="right" class="bg">证件号码:</td>
                        <td id="document_no">${customer.document_no} </td>
                    </tr>
                  <tr>
                       <td width="15%" align="right" class="bg">借款人名拼音：</td>
                       <td width="35%">${customer.customerFamilyNamePy} </td>
                       <td width="15%" align="right" class="bg">借款人姓拼音：</td>
                       <td >${customer.customerGivenNamePy} </td>
                    </tr>
                     <tr>
                 
                       <td width="15%" align="right" class="bg">发证机构:</td>
                       <td colspan="3">${customer.issuing_authority}</td>
                    </tr>
                    
                    <tr>
                        <td width="15%" align="right" class="bg">性别 :</td>
                        <td id="sex"></td>
                        <td width="15%" align="right" class="bg">证件有效期:</td>
                        <td>
                        <@date name="license_expiration_date" disabled="disabled" class="bn" value="${(customer.license_expiration_date?string('yyyy-MM-dd'))!''}" />
                        </td>
                    </tr>
                    
                     <tr>
						<td width="15%" align="right" class="bg">年龄:</td>
                        <td><span id="show_age"></span>（岁）</td>
                        <td width="15%" align="right" class="bg">学历:</td>
                        <td>
                        	<@select dataSouceFrom="CRM" dataSouceType="education" value="${customer.education}"  renderonly="true"/>
                        </td>
                    </tr>
                    
                    <tr>
                    	<td width="15%" align="right" class="bg">婚姻状况:</td>
                        <td>
                        	<label>
                            	<#if "${customer.marital_status}" == "1" > 
								未婚   
								<#elseif "${customer.marital_status}" == "2"> 
								已婚 
								<#elseif "${customer.marital_status}" == "3">
							           离异   
					           <#elseif "${customer.marital_status}" == "4">
							          丧偶   
					           <#else>
			    				 未婚   
							   </#if> 
                            </label>
                        </td>
                        
                        <td width="15%" align="right" class="bg">微信号 :</td>
                        <td>${customer.wechat}</td>
                    </tr>
                    <tr>
                        <td width="15%" align="right" class="bg">住宅电话:</td>
                        <td>${customer.home_phone}</td>
	                    <td width="15%" align="right" class="bg">联系电话 :</td>
                        <td> ${customer.user_phone}</td>
                    </tr>
                     <tr>
                    	<td width="15%" align="right" class="bg">单位邮编:</td>
                        <td>${customer.postcode}</td>
                        <td width="15%" align="right" class="bg">
						<span >借款人户口所在地:</span></td></td>
                        <td>
                        	<@select dataSouceFrom="CRM" dataSouceType="BORROWER_CENSUS_REGISTER" value="${customer.borrower_census_register}"  renderonly="true"/>
                        </td>
                    </tr>
                    <tr>
                        <tr>
							<td width="15%" align="right" class="bg">户籍地址 :</td>
							<td colspan="3">
								<@select dataSouceType="province" value="${customer.account_province}" renderonly="true"/>&nbsp;&nbsp;
								<@select dataSouceType="city" value="${customer.account_city}"  renderonly="true"/>&nbsp;&nbsp;
								<@select dataSouceType="COUNTY" value="${customer.account_county}"  renderonly="true"/>&nbsp;&nbsp;
	                    		${customer.permanent_residence}
							</td>
						</tr>
                        
                    </tr>
                    <tr>
                        <td width="15%" align="right" class="bg">居住地址:</td>
                        <td colspan="3">
                        	<@select dataSouceType="province" value="${customer.recipient_province}" renderonly="true"/>&nbsp;&nbsp;
							<@select dataSouceType="city" value="${customer.recipient_city}"  renderonly="true"/>&nbsp;&nbsp;
							<@select dataSouceType="COUNTY" value="${customer.recipient_county}"  renderonly="true"/>&nbsp;&nbsp;
                    		${customer.recipient_address}
					</td>
                    </tr>
                    <tr>
                        <td width="15%" align="right" class="bg">居住年限	:</td>
                        <td colspan="3">${customer.live_years}(年)</td>
                    </tr>
                         <#if customer.marital_status==2>
					    <tr>
						     <td width="15%" align="right" class="bg">结婚日期:</td>
						     <td colspan="3">
						       
						         ${(customer.marryDate?string('yyyy-MM-dd'))!''}
							  
						     </td>
						</tr>
			     </#if>
		        <#if customer.marital_status==3 >
			       <tr>
					    <td width="15%" align="right" class="bg">离婚日期:</td>
						<td colspan="3">					
							 ${(customer.divorceDate?string('yyyy-MM-dd'))!''}
								
					    </td>
				  </tr>    
		       </#if>
                    <tr>
                        <td width="15%" align="right" class="bg">子女情况	:</td>
                        <td colspan="3"><textarea style="width: 350px" name="children_info" disabled="disabled">${customer.children_info} </textarea></td>
                    </tr>
                    <tr>
                        <td width="15%" align="right" class="bg">其他信息描述	:</td>
                        <td colspan="3"><textarea style="width: 350px" name="other_info_desc" disabled="disabled">${customer.other_info_desc} </textarea></td>
                    </tr>
			   </tbody>
          </table>
	</div> 
	</div>
</div>

 <@js>
	 var document_no = $('#document_no').text();
	 $('#show_age').text(getAge(document_no));
	 $('#sex').text(getSex(document_no) == 'M'? '男':'女 ');
	 
	 //根据身份证信息获取年龄
	function getSex(UUserCard){
		//获取出生日期
		UUserCard.substring(6, 10) + "-" + UUserCard.substring(10, 12) + "-" + UUserCard.substring(12, 14);
		//获取性别
		if (parseInt(UUserCard.substr(16, 1)) % 2 == 1) {
			//alert("男");
		  	return 'M';
		} else {
			//alert("女");
			return 'F';
		}
	}
	
	  function getAge(UUserCard){
		var myDate = new Date();
		var month = myDate.getMonth() + 1;
		var day = myDate.getDate();
		var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
		if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
			age++;
		}
		//alert(age);
		return age;
    }
	
</@js>
<@jsRender/>
